#include <iostream>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>


int main()
{
    // Create the main window
    sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
 
    // Load a sprite to display
    sf::Texture texture;
    if (!texture.loadFromFile("[!output PRODUCT_INSTALLATION_DIR]//Images//sfml2.png"))
	{
		return EXIT_FAILURE;
	}   
	sf::Sprite sprite(texture);
    sf::Text text("Hello SFML");
 
    
    // Start the game loop
    while (window.isOpen())
    {
        // Process events
        sf::Event event;
        while (window.pollEvent(event))
        {
            // Close window : exit
            if (event.type == sf::Event::Closed)
			{
				texture.~Texture();
                window.close();			 
			}
        }
		if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape))
		{
			texture.~Texture();
			window.close();
		}
		
        // Draw the sprite
		window.draw(text);
        window.draw(sprite);
		
        // Update the window
        window.display();
    }
	
    return EXIT_SUCCESS;
}